package com.btks.jswater.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.btks.jswater.entity.Value;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ValueMapper extends BaseMapper<Value> {
    @Select("SELECT DATE AS TIME,RESULT AS SL,WATER_FLOW AS LL FROM \"value\" WHERE DATE>='2021-11-10'")
    List<Value> getValue();

    //灌区测水
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_guanqu")
    List<JSONObject> getGuanquInfo();
    @Select("select * from water_guanqu where gid='${id}'")
    JSONObject getGuanquInfoId(@Param("id")String id );

    //人引工程
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_people")
    List<JSONObject> getpeopleInfo();
    @Select("select * from  water_people where gid='${id}'")
    JSONObject getpeopleInfoId(@Param("id")String id );

    //水渠
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_shuiqu")
    List<JSONObject> getshuiquInfo();
    @Select("select * from  water_shuiqu where gid='${id}'")
    JSONObject getshuiquInfoId(@Param("id")String id );

    //水闸
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_shuizha")
    List<JSONObject> getshuizhaInfo();
    @Select("select * from  water_shuizha where gid='${id}'")
    JSONObject getshuizhaInfoId(@Param("id")String id );


    //水电站
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_station")
    List<JSONObject> getstationInfo();
    @Select("select * from  water_station where gid='${id}'")
    JSONObject getstationInfoId(@Param("id")String id );

    //水文测站
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_stations")
    List<JSONObject> getstationsInfo();
    @Select("select * from  water_stations where gid='${id}'")
    JSONObject getstationsInfoId(@Param("id")String id );

    //团区划
    @Select("SELECT gid ,xzqmc,x,y,add_time FROM water_tuan")
    List<JSONObject> gettuanInfo();
    @Select("select * from  water_tuan where gid='${id}'")
    JSONObject gettuanId(@Param("id")String id );
    //

    //地下水
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_underwater")
    List<JSONObject> getuwInfo();
    @Select("select * from  water_underwater where gid='${id}'")
    JSONObject getuwId(@Param("id")String id );

    //河流
    @Select("SELECT gid ,name,x,y,add_time FROM water_river")
    List<JSONObject> getRiverInfo();
    @Select("select * from  water_river where gid='${id}'")
    JSONObject getRiverId(@Param("id")String id );

    //水库
    @Select("SELECT gid ,name,x,y,depart,admin,add_time FROM water_shuiku")
    List<JSONObject> getshuikuInfo();
    @Select("select * from  water_shuiku where gid='${id}'")
    JSONObject getshuikuId(@Param("id")String id );
}
